package com.cloudlinkscm.base.filecenter.common;

import com.cloudlinkscm.loms.framework.dao.BizDataInterface;
import com.cloudlinkscm.loms.framework.util.SpringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.MessageSource;
import org.springframework.context.support.ResourceBundleMessageSource;

import java.util.Locale;

/**
 * Created by syq on 2017/5/23.
 */
public class I18NUtil {
    private static MessageSource messageSource = SpringUtils.getBean(ResourceBundleMessageSource.class);
    private static BizDataInterface bizDataInterface = BizDataInterface.getBean();

    public static String getMessage(String s, Object... objects) {
        if (StringUtils.isEmpty(s)) {
            return StringUtils.EMPTY;
        }
        //todo::
        return messageSource.getMessage(s, objects, Locale.SIMPLIFIED_CHINESE);
    }

    public static String getMessage(String s) {
        return getMessage(s, null);
    }
}
